class Gloves{
public:
	int findMinimum(int n,vector<int> left,vector<int> right){
		int sum=0;
		int l_mi=1e9,r_mi=1e9,l_sum=0,r_sum=0;
		for(int i=0;i<n;i++){
			if(left[i]*right[i]==0){
				sum+=left[i]+right[i];
			}
			else{
				l_sum+=left[i];
				l_mi=min(l_mi,left[i]);
				r_sum+=right[i];
				r_mi=min(r_mi,right[i]);
			}
		}
		int mi=min(l_sum-l_mi+1,r_sum-r_mi+1);
		return sum+mi;
	}
};
